<html>
<script type="text/javascript">
var flag=false;
window.onload=function(){ 
	
	 
	var cookies = document.cookie.split("; ");//将获得的所有cookie切割成数组 
	for(var i=0;i<cookies.length;i++)
	{
		if(cookies[i].split('=')[0]=="password"){		
			flag = true;
		}
	}
}	
function post(){
	if(flag==true){
		alert("post successfully");
		var form = document.getElementById('post');
		form.submit();
	}		
	else{
		alert("Please sign up in first");
		window.location.href="http://127.0.0.1:5222/login.html";
	}
}
</script>
<head >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text-align="center">	
<span id="username" /><br>
<form id="post" action="post.php" method="POST" > 
	<div style="width:100%; text-align:center ">	
	title:<input type="text" style="width:300px" maxlength=15 id="title" name="title" align="center"/> <br>

	<textarea style="width:800px; height:300px; " id="content" name="content" maxlength=800></textarea><br>
	<input type="button" value="发表" onclick="post()"/>
	</div>
</form>
</body>
</html>
